/*
 * mpcc.h
 *
 *  Created on: Apr 1, 2024
 *      Author: Yiwen Zhu
 */

#ifndef SELF_DEFINE_MPDTC_H_
#define SELF_DEFINE_MPDTC_H_

#include "my_def.h"
#include "main.h"


typedef struct 	{ _iq  Rs;
				_iq Ld;
				_iq Lq;
				_iq Psif;
				_iq We;
				_iq Np;
				_iq Ref_Trq;
				_iq Ref_Flux;
				_iq Fdb_Trq;
				_iq Fdb_Flux;
				_iq Fdb_Id;
				_iq Fdb_Iq;
				_iq Weight_Flux;
				_iq Ts;
				_iq Vd_Last;
				_iq Vq_Last;
				_iq g_opt;
				_iq K1; 	// Ts/Ld
				_iq K2;		// Rs*Ts/Ld
				_iq K3;		// Lq/Ld*Ts
				_iq K4;		// Ts/Lq
				_iq K5;		// Rs*Ts/Lq
				_iq K6;		// Ld*Ts/Lq;
				_iq K7;		// Psif*Ts/Lq
				_iq sin;
				_iq cos;
				_iq Udc;
				_iq Val[7];
				_iq Vbe[7];
				int Ta;
				int Tb;
				int Tc;
				int Index_Last;
				int Index_Last2;
				} MPDTC;


/*-----------------------------------------------------------------------------
Default initalizer for the SVGEN object.
-----------------------------------------------------------------------------*/
#define MPDTC_DEFAULTS { 0 }



void mpdtc_task(void);
void mpdtc_init(void);
void mpdtc_param_update_online(void);
void mpdtc_evenhand_task(void);

#endif /* SELF_DEFINE_MPCC_H_ */
